<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新增-权限菜单</title>
    <link rel="stylesheet" th:href="@{/resources/bootstrap/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/resources/awi/css/font-awesome.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/resources/awi/css/AdminLTE.min.css}">
    <link rel="stylesheet" th:href="@{/resources/awi/css/skins/all-skins.min.css}">
    <link rel="stylesheet" th:href="@{/resources/plugins/ztree/css/ztreeStyle/ztreeStyle.css}">
</head>
<body>
<div class="container-fluid">
<div class="row">
    <div class="col-md-12">
        <div class="page-header">
            <h3>任务协同
                <small>新建任务</small>
            </h3>
        </div>
    </div>
</div>
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <div class="box box-solid box-info">
                <div class="box-body">
                    <form role="form" id="taskCreate-form" action="/task/createTask"  method="post">
                        <input type="hidden" name="ownerUid" th:value="${uid}">
                        <div class="form-group">
                            <label for="taskName">任务标题 </label>
                            <input class="form-control" name="taskName" id="taskName" placeholder="菜单名称">
                        </div>
                        <div class="form-group">
                            <label for="priority">优先级 </label>
                            <select class="form-control" name="priority" id="priority">
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="taskDescription">任务描述 </label>
                            <textarea class="form-control" name="taskDescription" id="taskDescription" placeholder="菜单名称">
                            </textarea>
                        </div>
                        <div class="form-group">
                            <label for="assignee">办理人 </label>
                            <input class="form-control" name="assigneeUid" id="assignee" placeholder="菜单名称">
                        </div>
                    </form>

                </div>
                <div class="box-footer">
                    <button type="button" id="submitBtn"  class="btn btn-primary pull-right" style="margin-left: 35px;" onclick="submitForm('#taskCreate-form')">提交</button>
                    <button type="button" id="resetBtn" class="btn btn-warning pull-right" onclick="resetForm('#authMenu-form')">重置</button>
                </div>
            </div>


        </div>

    </div>

</div>

</body>
<!-- jQuery 2.2.3 -->
<script th:src="@{/resources/plugins/jQuery/jquery-2.2.3.min.js}"></script>
<!-- Bootstrap 3.3.6 -->
<script th:src="@{/resources/bootstrap/js/bootstrap.min.js}"></script>
<script th:src="@{/resources/layer/layer.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/resources/awi/js/app.js}"></script>
<!--tabs-->
<script th:src="@{/resources/awi/js/app_iframe.js}"></script>
<script th:src="@{/resources/plugins/ztree/js/jquery.ztree.all.js}"></script>
<script th:src="@{/resources/commons/js/prototype.js}"></script>
<script type="text/javascript">
    $(function () {
        $.get("/authCategory/listDictionary",function(response){
            var optionList = response.data;
            $.each(optionList,function (index,item) {
                $("#categoryUid").append('<option value="'+item.uid+'">'+item.NAME+'</option>');
            });
        });
    })
    function showMenuTree(){
        var setting = {
            check: {
                enable: true,
                chkStyle: "radio",
                radioType: "all"
            },
            callback: {
                onCheck: parentCheck
            },
            data: {
                simpleData: {
                    enable: true
                }
            }
        };

        $.get("/authMenu/listMenuTree?categoryUid=" + $("#categoryUid").val(), function (data) {
            layer.open({
                title:'请选择父级菜单',
                content:'<ul class="ztree" id="parent-menu-tree"></ul>',
                area: ['340px', '415px']
            });
            $.fn.zTree.init($("#parent-menu-tree"), setting, data);
        });
    }
    function parentCheck(event, treeId, treeNode) {
        $("#parentUid").val(treeNode.id);
        $("#parentName").val(treeNode.name);
    };
    function setCategory(){
        $("#category").val($("#categoryUid").find("option:selected").text())
    }
</script>
</html>